﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using RFIDStockManagement.Common.Public.Enums;

namespace RFIDStockManagement.Model.Public
{
    public class ReportColumn
    {
        private string _fieldName;
        private string _Caption;
        private bool _Visible;
        private int _width;
        private List<ReportColumn> _sonColumns;
        private int _index;
        private string _formateString;
        private EnumDataTypes _columnType;

       

        public ReportColumn(string fieldName, string capion)
        {
            _fieldName = fieldName;
            _Caption = capion;
            _Visible = true;
            _formateString = string.Empty;
            _columnType = EnumDataTypes.TString;
        }

        public EnumDataTypes ColumnType
        {
            get { return _columnType; }
            set { _columnType = value; }
        }
        /// <summary>
        /// 格式化样式
        /// </summary>
        public string FormateString
        {
            get { return _formateString; }
            set { _formateString = value; }
        }

        /// <summary>
        /// 列所处的顺序
        /// </summary>
        public int Index
        {
            get { return _index; }
            set { _index = value; }
        }

        /// <summary>
        /// 合并表头所属的列
        /// </summary>
        public List<ReportColumn> SonColumns
        {
            get {
                if (_sonColumns == null)
                {
                    _sonColumns = new List<ReportColumn>();
                }
                return _sonColumns;
            }
            set { _sonColumns = value; }
        }

        /// <summary>
        /// 宽度
        /// </summary>
        public int Width
        {
            get { return _width; }
            set { _width = value; }
        }

        /// <summary>
        /// 可见性
        /// </summary>
        public bool Visible
        {
            get { return _Visible; }
            set { _Visible = value; }
        }

        /// <summary>
        /// 标题
        /// </summary>
        public string Caption
        {
            get { return _Caption; }
            set { _Caption = value; }
        }

        /// <summary>
        /// 对应数据列名
        /// </summary>
        public string FieldName
        {
            get { return _fieldName; }
            set { _fieldName = value; }
        }
        
    }

    
}
